home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / EDITORS / ZAP130 / !Zap / Docs / E-Vars < prev    next >
Text File  |  1995-06-19  |  7KB  |  194 lines

  1. *************************************************************************
  2. * >E-Vars    Documents the variable numbers used by Zap_ReadVar    *
  3. *************************************************************************
  4.  
  5. This documents the variable numbers used by the Zap_ReadVar and Zap_WriteVar
  6. calls. It also documents the Config file format. Please note that the
  7. variables with names beginning 'opt_' are stored in the !Config file and thus
  8. saved when the user clicks 'Options.Save'.
  9.  
  10. The options for a given mode are also stored in the !Config file. See below.
  11.  
  12. Number:    Variable name:    Contents:
  13.  
  14. 0    scn_xos        Screen horizontal size (in os coords)
  15. 1    scn_yos        Screen vertical size (in os coords)
  16. 2    opt_flags    Config file flags word  (see E-Flags)
  17. 3    opt_format    Config file format word (see E-Format)
  18. 4    wimp_task    Zaps task handle
  19. 5    car_cursor    Cursor caret block pointer (see E-Cursors)
  20. 6    car_input    Input caret block pointer (see E-Cursors)
  21. 7    car_selection    Selection caret block pointer (see E-Cursors)
  22. 8    wind_num    Number of window blocks (see E-Windows)
  23. 9    file_num    Number of file blocks (see E-File)
  24. 10    car_mode    Current cursor editing mode (see E-Cursors)
  25. 11    wimp_version    Version number Zap logged on as (200/300/350)
  26. 12    key_default    Default key map number
  27. 13    key_basemap    Basemap number
  28. 14    key_last    Zap key code of last key processed
  29. 15    key_lastcom    Address of last key command executed
  30. 16    mini_ptr    Address of minibuffer
  31. 17    mini_bufl    Size of minibuffer
  32. 18    mini_len    Size of data in minibuffer
  33. 19    mini_off    Offset of cursor in minibuffer
  34. 20    mini_mark    Offset of mark in minibuffer (see Zap_MiniWrite)
  35. 21    yank_ptr    Address of kill ring buffer
  36. 22    yank_len    Size of data in kill ring buffer
  37. 23    key_current    Current keymap number
  38. 24    reserved    (was control character set number)
  39. 25    opt_tab        Default column tab for windows.
  40. 26    opt_addr    Default address of first byte of file.
  41. 27    opt_stline    Default number of first line of file.
  42. 28    opt_linesp    Default line spacing in 1/8ths char.
  43. 29    env_start    Bottom of Zaps stack (&8000 except in test modes)
  44. 30    env_top        Start of free memory.
  45. 31    wimp_iconbar    Handle of iconbar icon.
  46. 32    wimp_timeformat    Standard time format string.
  47. 33    wimp_dateformat    Standard date format string.
  48.  
  49. Setting & Reading default mode options
  50. --------------------------------------
  51.  
  52. Each mode has a word of workspace in a window block called w_moden (see
  53. E-Windows). When a window is created, the default settings (stored in the
  54. !Config file) for that mode is used. These default settings are stored in
  55. memory, and saved when the user clicks on the 'save options' menu entry.
  56. The variable number &100+n accesses the default mode word for mode numbered
  57. n. Ie,
  58.  
  59. &100    opt_mode0    Text mode word
  60. &101    opt_mode1    Byte mode word
  61. &102    opt_mode2    Word mode word
  62. ... etc ...
  63.  
  64. If there was no information about the mode in the !Config file then the mode
  65. word is set to 0. In this case, the mode should note this on startup (see
  66. e_init with R1=2) and write some sensible default values to it. If the mode
  67. has b10 set in it's e_mode word, then the mode word points to a block of
  68. data, the first word in the block giving the total length of the block. The
  69. mode can resize this block at any time using the standard heap calls. If the
  70. mode word was 0 then the mode should claim a block at startup and set it up
  71. with default values (and save the address of it's block in the mode word via
  72. Zap_WriteVar).
  73.  
  74. If your mode word is zero when you start up then you should also define
  75. sensible colours for your mode using Zap_ModeColours and a sensible width etc
  76. using Zap_ModeData.
  77.  
  78. !Config file format (Version 1.10+)
  79. -----------------------------------
  80.  
  81. The first word must be the bytes for the letters "Conf". Then the !Config
  82. file consists of a list of blocks, terminated by a zero word. Each block has
  83. the following format:
  84.  
  85.  #0    Block type:    0    End of list.
  86.              1    Zap global options storage block.
  87.              2    Mode dependant storage block.
  88.              3+    Reserved
  89.  #4    Total block length (offset from start of block to next block).
  90.  #8 ...    Block data
  91.  
  92. Block type 1 is version dependent (see below).
  93.  
  94. If the block type is 2 then the block data has the following format
  95.  
  96.     #0    Mode name, zero terminated then align to next word.
  97.         Length of Zap handled data for this mode (see below)
  98.         Zap handled data for this mode (version dependant)
  99.         Length of Mode handled data for this mode (0 if none).
  100.         Mode handled data for the mode (mode dependant).
  101.  
  102. (NB If b10 of e_mode is set then the last two entries are written into a heap
  103. block whose address is stored in opt_moden where n is the mode number which
  104. is assigned to the mode. If not, the the first word of the data is put
  105. in opt_moden)
  106.  
  107. Version 1.10
  108. ------------
  109.  
  110. The format of the Zap handled bits for version 1.1 is:
  111.  
  112. Block type 1 data: (total block length 8+&54=&5C)
  113.  
  114.         #&00    Reserved (set to 0)
  115.                 #&04    Reserved
  116.                 #&08    Reserved
  117.                 #&0C    Reserved
  118.                 #&10    Reserved
  119.                 #&14    character set to use for control characters (0-3)
  120.         #&18    column tab width
  121.         #&1C    opt_flags value (see E-Flags)
  122.         #&20    opt_format value (see E-Flags)
  123.         #&24    address of first byte of file (for line numbers)
  124.         #&28    line number of first line of file
  125.         #&2C    line spacing
  126.         #&30    margin width
  127.         #&34    cursor types byte0=normal cursor byte1=split1 cursor
  128.             byte2=split2 cursor byte3=mark position cursor.
  129.             0=block 1=square 2=underscore 3=bar 4=none
  130.             5+=undefined
  131.         #&38    Code of end of line x4 (eg &0a0a0a0a)
  132.         #&3C    Code of tab character x4 (eg &09090909)
  133.         #&40    Wordwrap width
  134.         #&44    Minibuffer colours byte0=background wimp col
  135.             byte1=foreground wimp colour
  136.         #&48    Switches flags word:
  137.             b0 set for flashing cursor
  138.             b1 must be 0
  139.             b2 set for date checking on file saving
  140.             b3 set for clear search window automatically
  141.             b4 must be 0
  142.             b5 must be 0
  143.             b6 set for confine cursor to window
  144.             b7 must be 0
  145.             b8-b31 reserved - must be 0
  146.         #&4C    Reserved
  147.         #&50    Reserved
  148.         
  149. Block type 2 data:
  150.  
  151. The Zap handled bit of it is 12 bytes long and documented below. The format
  152. may change with future versions and should be read via Zap calls
  153. Zap_ModeColour and Zap_ModeData if you are a Zap extension mode.
  154.  
  155.     #0    Mode data variable 0 - see Zap_ModeData call.
  156.     #4     The current palette for this mode. The 16 nibbles give
  157.         the wimp colours of the 16 colours with nibble0=background
  158.         colour 1, nibble1=background colour 2 etc.
  159.         See Zap_ModeColour.
  160.  
  161. Version 1.20
  162. ------------
  163.  
  164. Block type 1 data:
  165.  
  166. The block has the same length and general format but the following offsets
  167. are changed.
  168.  
  169.     #&44 Reserved - should be set to 0. (if non zero then old format)
  170.     #&4C Minibuffer background palette entry word.
  171.     #&50 Minibuffer foreground palette entry word.
  172.  
  173. Block type 2 data:
  174.  
  175. The Zap handled bit is now of variable length and of the format:
  176.  
  177.     #0    Mode data variable 0 - see Zap_ModeData
  178.     #4    Mode data variable 1
  179.         ...
  180.         -1 (to terminate mode data variable list)
  181.         Colour 0 (24 bit of form &BBGGRRZZ where ZZ is the Zap)
  182.         Colour 1 (style - &10 is default)
  183.         Colour 2
  184.         ... until end of block (length of block determines number
  185.             of colours).
  186.  
  187. Version 1.30
  188. ------------
  189.  
  190. Block type 1 data:
  191.  
  192. The following changes have been made:
  193.     #&14    Now reserved, no longer the control character set.
  194.